1. Technical Field
The present invention relates in general to computer storage devices and, in particular, to an optical Write-Once Read-Many (WORM) medium. Still more particularly, the present invention relates to a method and program product for recovering lost data from an optical WORM medium.
2. Description of the Related Art
Sensitive data, such as a customer""s banking records, legal documents, etc., are often permanently stored in a medium that permits access for later viewing of the stored data but prevents tampering and/or erasure of the data. Common examples of such a medium are the optical write-once read-many (WORM) medium and the compact disc recordable medium (CD-ROM). Present implementation of the WORM medium utilizes an optical scanner, i.e., a laser, to write and read the data, stored as files on the medium.
As the name implies, a WORM medium enables data to be written on the medium once and accessed many times thereafter. The data files are identified and access via a hash and/or hierarchical directory entry stored on the medium. Data stored on a WORM medium are considered secure because the data can not be erased from the medium or easily corrupted by an external source. The data are thus expected to be available and accessible for as long as the medium is available, and hence the WORM medium provides reliable data storage for lifetime documents.
Typically, the data in a WORM medium are accessed via one of two directory entries, a hash or a hierarchical entry. Both hash and hierarchical entries are fundamental to the data they are associated with, and both provide a backup function for each other. The hash and hierarchical entries are created at the same time the data is written on the WORM medium. Depending upon the access method utilized, one of the two entries is utilized to retrieve the data from the medium during later access.
The protection provided by the WORM medium, however, does not always prevent files from becoming damaged. Many factors such as power failure, device problems, software problems, user""s improper operation of the device, etc., may cause damage to the stored data. Also, failure of the WORM medium may occur for a number of reasons, including calibration track damage, electric static discharge damage, or contaminants embedded on the medium. When damage to the files on the medium occurs, some of the data stored in the medium will no longer be accessible by users with the normal data retrieval procedures that utilize a data retrieval application.
In some instances, the damage may be permanent, (e.g., physical damage to the media, raw data area (sectors) damage, etc.) and the data will never be recovered. However, most of the time data retrieval problems encountered with a WORM medium is caused by damage to a directory entry, which prevents the associated data from being accessible by referencing that directory entry. Directory entry damage may be attributed to the fact that, with most file system design, the directory entry sector on the medium is scanned very often compared to the area on which the data is stored, leading to excessive wear and eventual damage. Thus, having a damaged data area is not uncommon for a file stored on a WORM medium.
Because the directory entries are initially stored in pairs, fixing a damaged directory entry of a file on a WORM medium is usually not a difficult task when the backup directory entry is available. Repairing a bad directory entry for a file using the good backup entry has become a standardized procedure.
In certain instances, however, both the hash and hierarchical file entries of a file are damaged or destroyed, and the user can no longer retrieve the file from the WORM medium although the file""s data are saved permanently on the WORM medium. Presently, there is no generally applicable way to recover a file if both directory entries are damaged. The situation may be especially critical for a file owner when there is no other source of the data except that on the WORM medium.
A file recovery logic implemented within a data processing system is disclosed that recovers data from a file on a write once read many (WORM) medium when the file cannot be accessed due to the damage to both the hash and hierarchical directory entries. The file recovery logic controls access to the WORM medium and also access to a target medium via optical devices that enable read from the WORM medium and write to the target medium. The file recovery logic scans each logical sector of the WORM medium""s data surface and identifies a location of a data header sector that corresponds to the unaccessible file. In the preferred embodiment, identification of the data header sector is completed by analyzing only the first few bytes of the sector. Upon location of the header sector, a new file is opened in a target medium and the data from contiguous sectors on the WORM medium beginning at the data header sector are retrieved and written to the new file on the target medium. The scanning, retrieving, and writing continue until a next header, a tail, or a blank sector is encountered, or the last sector on the medium""s scanning range is reached. The new file is then stored on the target medium with the data from the unaccessible file, and thus, the previously unaccessible data is made available.
All objects, features, and advantages of the present invention will become apparent in the following detailed written description.